Merged from gtk-2-10:
authorFederico Mena Quintero <federico@novell.com>
Fri, 15 Dec 2006 20:13:01 +0000 (20:13 +0000)
committerFederico Mena Quintero <federico@src.gnome.org>
Fri, 15 Dec 2006 20:13:01 +0000 (20:13 +0000)
2006-12-15  Federico Mena Quintero  <federico@novell.com>

Merged from gtk-2-10:

* gtk/gtkmenu.c (gtk_menu_set_title): Don't try to optimize for
the case where the new title is the same as the old title, to
preserve the behavior from GTK+ 2.8 (NULL and "" titles are not
equivalent).  Handle the case where title == priv->title.  This
was found by the LSB compatibility tests:
https://bugzilla.novell.com/show_bug.cgi?id=223882

2006-12-15  Dom Lachowicz <domlachowicz@gmail.com>

ChangeLog
gtk/gtkmenu.c

index a302da793be826e1516bd4c135930125b77a7c18..4da46f94cc0fa1a6671b1f84b8380f7ecc72f50d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2006-12-15  Federico Mena Quintero  <federico@novell.com>
+
+       Merged from gtk-2-10:
+
+       * gtk/gtkmenu.c (gtk_menu_set_title): Don't try to optimize for
+       the case where the new title is the same as the old title, to
+       preserve the behavior from GTK+ 2.8 (NULL and "" titles are not
+       equivalent).  Handle the case where title == priv->title.  This
+       was found by the LSB compatibility tests:
+       https://bugzilla.novell.com/show_bug.cgi?id=223882
+
 2006-12-15  Dom Lachowicz <domlachowicz@gmail.com>
 
        * gtk/gtkcombobox.c: Make GtkComboBox in "appears-as-list" mode
index be89918fce2b71c6e2cba94fbe33f31849d99f18..7460061231ab9392f35a1c7450380a192e102965 100644 (file)
@@ -1913,26 +1913,27 @@ gtk_menu_get_tearoff_state (GtkMenu *menu)
  * @title: a string containing the title for the menu.
  * 
  * Sets the title string for the menu.  The title is displayed when the menu
- * is shown as a tearoff menu.
+ * is shown as a tearoff menu.  If @title is %NULL, the menu will see if it is
+ * attached to a parent menu item, and if so it will try to use the same text as
+ * that menu item's label.
  **/
-void       
+void
 gtk_menu_set_title (GtkMenu     *menu,
                    const gchar *title)
 {
   GtkMenuPrivate *priv;
+  char *old_title;
 
   g_return_if_fail (GTK_IS_MENU (menu));
 
   priv = gtk_menu_get_private (menu);
 
-  if (strcmp (title ? title : "", priv->title ? priv->title : "") != 0)
-    {
-      g_free (priv->title);
-      priv->title = g_strdup (title);
+  old_title = priv->title;
+  priv->title = g_strdup (title);
+  g_free (old_title);
        
-      gtk_menu_update_title (menu);
-      g_object_notify (G_OBJECT (menu), "tearoff-title");
-    }
+  gtk_menu_update_title (menu);
+  g_object_notify (G_OBJECT (menu), "tearoff-title");
 }
 
 /**